package
{
	import com.net.AssetData;
	import com.ui.containers.TitleWindow;
	import com.ui.core.Align;
	import com.ui.data.TitleWindowData;
	import com.ui.layout.GLayout;
	import com.ui.skin.SkinStyle;
	
	import flash.display.DisplayObjectContainer;
	import flash.geom.Rectangle;
	
	import robotleMvc.ui.SkinType;
	import robotleMvc.ui.UIUtil;

	public class Pan3dWindow extends TitleWindow
	{
		public static const s_LeftFrameWidth : int = 13;
		public static const s_RightFrameWidth : int = 13;
		public static const s_BottomFrameHeight : int = 7;
		public static const s_TitleBarHeight : int = 60;
		public static const s_TitleBarWidth : int = 155;
		public static const s_NormalTextFmt : int = 0;
		public static const s_ColorTextFmt : int = 1;
		public static const s_HtmlTextFmt : int = 2;
		
		public function Pan3dWindow(parent:DisplayObjectContainer, isTitleBar:Boolean=true)
		{
			if (!_data){
				_data=new TitleWindowData();
				_data.parent=parent;
				initWindow();
			}
			_data.titleBarData.backgroundAsset =  UIUtil.frameOutShow();
			super(_data);
			
		}
		/**
		 * 初始化窗体的其它数据
		 */
		private function initWindow():void
		{
			_data.titleBarData.labelData.text="控制面板";
			_data.width=200;
			_data.height=250;
			_data.titleBarData.y=30;
			_data.align=Align.RIGHT;
			_data.allowDrag=true;
			_data.panelData.bgAsset= UIUtil.frameOutShow();
			_data.closeButtonData.upAsset=new AssetData(SkinType.CLOSE_UP);
			_data.closeButtonData.downAsset=new AssetData(SkinType.CLOSE_DOWN);
			_data.closeButtonData.overAsset=new AssetData(SkinType.CLOSE_OVER);
			
			
		}
		public function set titleName(value : String) : void
		{
			_titleBar.text = "<font color='#EBDF8B'>" + value + "</font>";
			_titleBar.label.x = _data.width / 2 - _titleBar.label.width / 2;
		}
		public function adjustWindowSize(w : int, h : int) : void
		{
			if (h < s_TitleBarHeight + s_BottomFrameHeight)
			{
				h = s_TitleBarHeight + s_BottomFrameHeight;
			}
			_data.titleBarData.y = 30;
			_data.width = w;
			_data.height = h;
			_titleBar.label.y = 0;
			setSize(w, h);
			_titleBar.baseData.width = w;
			_titleBar.resetBG();
		}
	
	}
}
